Genericity through Constrained Types

نویسندگان

  • Nathaniel Nystrom
  • Olivier Tardieu
  • Igor Peshansky
  • Vijay Saraswat
چکیده

Modern object-oriented languages such as X10 require a rich framework for types capable of expressing valuedependency, type-dependency and supporting pluggable, application-specific extensions. In earlier work, we presented the framework of constrained types for concurrent, object-oriented languages, parametrized by an underlying constraint system C . Constraint systems are a very expressive framework for partial information. Types are viewed as formulas C{c} where C is the name of a class or an interface and c is a constraint in C on the immutable instance state of C (the properties). Many (value-)dependent type systems for object-oriented languages can be viewed as constrained types. This paper extends the constrained types approach to handle type-dependency (“genericity”). The key idea is to extend the constraint system to include predicates over types such as X is a subtype of T. Generic types are supported by introducing parameters and properties that range over types and permitting the user program to impose constraints on such variables. Type-valued properties are required to have a run-time representation—the run-time semantics is not defined through erasure. Run-time casts are permitted through dynamic code generation. To illustrate the underlying theory, we develop a formal family FX(C ) of programming languages with a common set of sound type-checking rules. By varying C and extending the type system, we obtain languages with the power of FJ, FGJ, dependent types, and new object-oriented languages that uniformly support valueand type-dependency. Concretely, we illustrate with the design and implementation of the type system for X10. The type system integrates and extends the features of nominal types, virtual types, and path-dependent types.

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Genja - A New Proposal for Parameterised Types in Java

Recent proposals for adding parameterised types to Java have left a number of important practical issues undiscussed. In this paper we present the language Genja which is a new generic extension of Java oriented towards practical support for generic collection types. We discuss design alternatives related to extending the power of unconstrained genericity, solving the weaknesses of constrained ...

متن کامل

Increasing Reuse in Component Models through Genericity

A current limitation to component reusability is that component models target to describe a deployed assembly and thus bind the behavior of a component to the data-types it manipulates. This paper studies the feasibility of supporting genericity within component models, including component and port types. The proposed approach works by extending the meta-model of an existing component model. It...

متن کامل

Semantics-Driven Genericity: A Sequel to the Static C++ Object-Oriented Programming Paradigm (SCOOP 2)

Classical (unbounded) genericity in C++03 defines the interactions between generic data types and algorithms in terms of concepts. Concepts define the requirements over a type (or a parameter) by expressing constraints on its methods and dependent types (typedefs). The upcoming C++0x standard will promote concepts from abstract entities (not directly enforced by the tools) to language construct...

متن کامل

Reuse Through Genericity in SUAVE

VHDL currently has a limited form of genericity in which component and entity declarations can be parameterized with formal generic constants. SUAVE extends the genericity mechanism by allowing formal generics types and by allowing generics to be specified in the interfaces of subprograms and packages. The approach is based on the features of Ada-95. It allows units to be re-used in a much wide...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2009